<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" >
<head>
	<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
	<meta http-equiv="X-UA-Compatible" content="edge" />
    <title>网站登录</title>
<script type="text/javascript">
console.info(window.location.port);
//if("80"!=window.location.port) {
//	alert(window.location.port+"访问路径不允许");
    //window.location.href = "../apply/main.jsp";
//}

var browser=navigator.appName
var b_version=navigator.appVersion
var version=b_version.split(";");
var trim_Version=version[1].replace(/[ ]/g,"");
if(browser=="Microsoft Internet Explorer" && (trim_Version=="MSIE7.0"||trim_Version=="MSIE6.0"))
{
    var returnVal = window.confirm("您的浏览器版本过低或者开启了兼容模式，无法使用本系统，点击确定跳转到帮助页面查阅登录方法", "标题");
    if(returnVal) {
    	window.location.href = "soft.html";
	} else {
		window.location.href = "AdminLogin.html";
	}
}
</script>  
<script type="text/javascript" src="../plugins/assets/plugins/jquery-3.5.1.min.js"></script>
<script type="text/javascript" src="js/util.js"></script>
    <style type="text/css">
		body
		{
			font: normal 14px/1.4 "Helvetica Neue","HelveticaNeue",Helvetica,Arial,sans-serif;
		}
		div
		{
			display:block;
		}
		a
		{
			text-decoration:none;
			opacity: 1;
			color: #fff;
		 }
		 input,button{ outline:none; }
		::-moz-focus-inner{border:0px;}   /*去除按钮点击时出现的虚线边框*/
        .login_bg
        {
			position: fixed;
			top: 0;
			right: 0;
			bottom: 0;
			left: 0;
			background-image:url(images/bg_1.jpg);
			background-size: cover;
        }
		.login_header {
			position:absolute;
			top:0;
			left:0;
			right:0;
			}
		.container {
			position:relative;
			top:50%;
			margin: 0 auto;
			width: 350px;
			}
		#logo
		{
			display: block;
			text-align: center;
			font-weight: bold;
			font-size: 40px;
			color: #529ecc;
			height: 100%;
			font-family: "Arial","Microsoft YaHei","黑体","宋体",sans-serif;
		}
		#subheading 
		{
		  position: relative;
		  width: 517px;
		  left: 50%;
		  margin: 10px 0 16px -258px;
		  font-size: 15px;
		  font-weight: normal;
		  color: #fff;
		  text-align: center;
		}
		.signup_forms
		{
			width:350px;
			height:145px;	
		}
		.signup_forms table {
			width:400px;
			height:200px;
		}
		.signup_forms table tr td {
			text-align:right;
			font: 18px;
			font-family: "Arial","Microsoft YaHei","黑体","宋体",sans-serif;
			color:#333;
		}
		.signup_forms_container
		{
			width:370px;
			height:280px;
			overflow: hidden;
			background: #fff;
			border-radius:3px;	
		}
		.form_user,.form_password
		{
			width:300px;
			height:45px;
			margin:0px;
        	padding:0px;
			border:0px;	
		}
		.form_password{border-top: 1px solid #e3e3e3;}
		.signup_forms input,.signup_forms select
		{
		    float:left;
			padding: 11px 10px 11px 13px;
			width: 80%;
			margin:0px;
        	background: 0;
			font: 16px/1.4 "Helvetica Neue","HelveticaNeue",Helvetica,Arial,sans-serif;
			border:1px #eee solid;	
			
		}
		
		#signup_forms_submit{
		  float:left;
		  margin:8px;		
		  width:180px;
		  height:45px;
		  background:#529ECC;
		  border:0px;
		  border-radius:3px;
		  cursor:pointer;       <!--CSS属性设置鼠标为手型--> 
		 }
		 #signup_forms_submit span
		 {
			 color: #fff;
			 font: "Helvetica Neue",Arial,Helvetica,sans-serif;
			 font-size:16px;
		}
		#reg_forms_submit{
		  float:left;
		  margin:8px;		
		  width:80px;
		  height:45px;
		  background:#22ac38;
		  border:0px;
		  border-radius:3px;
		  cursor:pointer;       <!--CSS属性设置鼠标为手型--> 
		 }
		 #reg_forms_submit span
		 {
			 color: #fff;
			 font: "Helvetica Neue",Arial,Helvetica,sans-serif;
			 font-size:16px;
		}
		.footer
		 {
			margin-top: 10px;
		 }
		 .footer_signup_link
		 {
			 width:370px;
			 height:78px;
			 bottom: 0;
			 padding: 0 2px;
			 line-height: 20px;
			 color: #fff;
		 }
		 .signup_link
		 {
			  display: block;
			  height: 30px;
			  padding: 0 10px;
			  font-size: 12px;
			  font-weight: bold;
			  line-height: 20px;
			  border: 0;
			  border-radius: 2px;
			  color: #fff;
              background: rgba(255,255,255,0.33);
		}
		.link
		{
			font-size: 14px;
			padding-right: 5px;
			margin-right: 12px;
			color: #fff;
		}
		.design_show
		{
			position: fixed;
			bottom: 0;
			right: 0;
			padding: 0 12px;
			margin: 0 0 13px 0;
			line-height: 25px;
		}
		.designer_info
		{
			position: relative;
			color: #FFFFFF;
		}
		#face
		{
			margin: 0 0 0 10px;
			vertical-align: middle;
			border-radius:20px;
			padding: 0;
			height: 24px;
			width: 24px;
		}
		#title {
			width:100px;
			float:left;
		}
    </style>

</head>
<body>
    <div id="login_bg" class ="login_bg" style="background-image:url(images/bg2.jpg);"></div>
    <div class="login_header">
    	<span></span>
    </div>
    
    <div class="container">
    	<div class="form_header">
        	<h1 id="logo">浙江省高校</br>三位一体综合评价招生系统V3.5</h1>
			<h2 id="subheading">版权所有@ 杭州智栖科技有限公司 - </h2>
        </div>
        <div class="signup_forms" class="signup_forms">
            	<div id="signup_forms_container" class="signup_forms_container">

<div id="login1">
<form id="form1" action="" method="post" onsubmit="return adminlogin();">
<table  border="0" cellpadding="2" cellspacing="2">
  <tr>
    <td>身份:</td>
    <td>
    <select id="roId" name="roId">
    </select>
    </td>
  </tr>
  <tr>
    <td width="60">账号:</td>
    <td>
    <input type="text" name="account" id="account"></td>
  </tr>
  <tr>
    <td>密码:</td>
    <td><input type="password" name="password" id="password" autocomplete="off"></td>
  </tr>
  <tr>
    <td>验证码:</td>
    <td><input type="text" name="rand" id="rand" style="width:100px;"><img style="cursor:pointer;width:60px;height:26px;float:left;margin:5px;" alt="" onclick="changeValidateCode()" ver_colorofnoisepoint="#888888"   id="JD_Verification1" src="../getValidateImage.action"></td>
  </tr>
  <tr>
    <td>&nbsp;</td>
    <td><button type="submit" id="signup_forms_submit"><span><strong>登录</strong></span></button></td>
  </tr>
</table>
</form>
</div>
    			</div>
            <div class="footer">
		    	<div class="footer_signup_link">
		        	<a class="signup_link" href="soft.html" target='_blank' id="message">账号密码正确却无法登录，请点击此处</a>
		        </div>
	    	</div>
    	</div>
    	
    	

    	
<script type="text/javascript">  

$.ajax({
    type : "post",
    url : "../anRoleList.action?randnum=", 
    success : function(res, status) {
    	console.info(res);
        $.each(res.rows, function(index, item) {
            $("#roId").append(  //此处向select中循环绑定数据
        	"<option value="+item.roId+">" + item.roName+ "</option>");
        });		
        $("#roId").append("<option value='0'>专家评审</option>");
	},
});
		
$.ajaxSetup({ cache: false }); 
function adminlogin() {
	var actionurl='../anAdminLogin.action?randnum='+Math.floor(Math.random()*1000000);
    if($("#roId").val()=='0'){
    	actionurl='../anUserLogin.action?randnum='+Math.floor(Math.random()*1000000)
    }

	if ($("#account").val() == "") {
		$("#message").html("登陆账号必须填写！");
	} else if ($("#password").val() == "") {
		$("#message").html("登陆密码必须填写！");
	} else if ($("#rand").val() == "") {
		$("#message").html("验证码必须填写！");
	} else {
		var jsonString = $("#form1").form2json();
		//console.info(jsonString);
		$.ajax({
	    	cache: false,
	    	type: "POST",
	        url:actionurl,
	        data:{rowstr:jsonString},// 你的formid
	        async: false,
	        dataType: 'json',
	        error: function(request) {
	        	alert("网络错误，无法连接到服务器。");
	        },
	        success: function(data) {
	        	console.log(data);
	        	var roId = $("#roId").val();
	        	if(data.message=="success"){
	            	alert("登录成功");
	            	if(roId.indexOf("0")>=0){
	            		window.location = './index_review.jsp'; ///当用ajax访问 时候成功的时候就自动的跳转过去
	            	} else {
	            		window.location = './index.jsp'; ///当用ajax访问 时候成功的时候就自动的跳转过去
	            	}
	        	} else if(data.message=="sqmfailed"){
	            	$("#message").html("登录失败，系统授权码错误！");
	        		alert("登录失败，系统授权码错误！");
	        		changeValidateCode();
	        	} else if(data.message=="randfailed"){
	            	$("#message").html("登录失败，验证码错误！");
	        		alert("登录失败，验证码错误！");
	        		changeValidateCode();
	        	} else if(data.message=="timefailed"){
	            	$("#message").html("密码错误或者身份设置有误超过5次，请于30秒稍后再试！");
	        		alert("密码错误或者身份设置有误超过5次，请于30秒稍后再试！");
	        		changeValidateCode();
	        	} else {
	        		$("#message").html("登录失败，用户名或密码错误或者身份设置有误！");
	        		alert("登录失败，用户名或密码错误或者身份设置有误！");
	        		changeValidateCode();
	        	}
	        }
	    });
	}
	return false;
}


function changeValidateCode() {    
      //这和浏览器的缓存机制有关系，也可以把页面设置为不缓存，这样就不用这个参数了。"nocache="+new Date().getTime()   
      document.getElementById("JD_Verification1").src=document.getElementById("JD_Verification1").src + "?nocache="+new Date().getTime();    
}   
	</script>
</body>
</html>